<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->comment('主键');
            $table->bigInteger('mobile')->unique()->comment('手机号');
            $table->string('password', 16)->default('')->comment('密码');
            $table->string('status', 12)->default('on')->comment('状态:on正常, off冻结');
            $table->string('role', 16)->default('user')->comment('角色: user用户, staff员工, admin管理员');
            $table->index('mobile');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
